'''
Created on Nov 29, 2010

@author: dexen
'''

from my_ind import MyInd
from dexen.system.common.base import Score

def dev_cond(ind):
    assert isinstance(ind, MyInd)
    return ind.is_alive() and ind.genotype != None and ind.phenotype == None

def energy_cond(ind):
    assert isinstance(ind, MyInd)
    assert isinstance(ind.energy, Score)
    return ind.is_alive() and ind.phenotype != None and ind.energy.value == None

def area_cond(ind):
    assert isinstance(ind, MyInd)
    assert isinstance(ind.area, Score)
    return ind.is_alive() and ind.phenotype != None and ind.area.value == None

def feedback_cond(ind):
    assert isinstance(ind, MyInd)
    assert isinstance(ind.energy, Score)
    assert isinstance(ind.area, Score)
    return ind.is_alive() and ind.energy.value != None and ind.area.value != None 
